Can't make created python function return a value which I can then use in another calculation